package com.ihunanren.taobao.module.screen;

import static com.google.common.base.Strings.isNullOrEmpty;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.dataresolver.Param;
import com.ihunanren.biz.taobao.ao.impl.CouponsAo;

public class CreateCoupons {

	private final static Logger log = LoggerFactory.getLogger(CreateCoupons.class);
	
	@Autowired
	private CouponsAo couponsAo;
	
	public void execute(@Param(name = "url", defaultValue = "") String url,
			Context context) throws Exception {
		if(isNullOrEmpty(url)){
			log.error("url is required.");
			return ;
		}
		couponsAo.searchCouponsByLink(url);
	}
}
